﻿using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity
{
    class SMDBContext
    {
        public class ApiDbContextFactory : IDesignTimeDbContextFactory<ApiDbContext>
        {
            public SMDBContext CreateDBContext(string[] arge)
            {
                var optionBuilder = new DbContextOptionBuilder<SMDBContext>();
                optionBuilder.UseMySql(
                    "server=localhost;userid=root;password=123456;database=AIYDB;port=3306;",
                    new MySqlServerVersion(new Version(8, 0, 41))
                    );

                return new SMDBContext(optionBuilder.Options);
            }
        }
    }
}
